Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
Webpack [contenthash] parse in files

I will do versioning via hashing. And this with Webpack.

Content of: webpack.config.js

...
output: {
    path: path.resolve(__dirname, 'web/dist'),
    filename: '[name].[contenthash].js',
},
...

webpack generate some files, i think its okay, its a hash... app.d471b97fd69a6837f5bf.js

In my index.html file must replace the filenames to, i do it with "replacer-contenthash-webpack-plugin" Plugin for Webpack. It used the loaderUtils.getHashDigest(buffer) do generate a hash. But its not the same its generate this 174d0b0d04495cf7a970 hash.

Content of: index.html <script src="dist/app.174d0b0d04495cf7a970.js"></script>

how can i fix it? I dont no how webpack generate the hash with [hashcode]. Its not specified.

i have tried, to specified contenthash digest, length and function:

output: {
    path: path.resolve(__dirname, 'web/dist'),
    filename: '[name].[contenthash].js',
    hashFunction: "md5",
    hashDigest: "hex",
    hashDigestLength: 32
},

and specified the used Webpack extension getHashDigest() so:

getHashDigest(buffer, "md5", "hex", 32)

=> app.54949ecc3046a8e7e56e8d9875970ca2.js but index.html different :( <script src="dist/app.174d0b0d04495cf7a970e84cc9a96cdb.js"></script>

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda